package use.io;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;

public class DiskOperation {
    public static void listAllFile(File dir) throws IOException {
        if (dir == null || !dir.exists()) {
            return;
        }
        if (dir.isFile()) {
            System.out.println(dir.getCanonicalPath() + dir.getName());
            return;
        }
        for (File file: dir.listFiles()) {
            listAllFile(file);
        }
    }

    public static void main(String[] args) throws IOException {
        DiskOperation.listAllFile(new File("/home/x/文档/gitee/java-learn/java基础/concurrency/src/use"));
        Files files;
    }
}
